package com.zr.controller;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.zr.service.Xiugaiservice;
import com.zr.serviceImpl.XiugaiserviceImpl;

public class XiugaiController extends HttpServlet{
        Xiugaiservice  x=new XiugaiserviceImpl();
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doPost(req, resp);
	}

	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
	        int eid =Integer.parseInt(req.getParameter("usernum"));
	        String ename=req.getParameter("username");
	         int eage=Integer.parseInt(req.getParameter("userage")) ;
	         String esex=req.getParameter("usesex");
	         String eidcard=req.getParameter("useidcard");
	         String eborn=req.getParameter("userborn");
	         String enation=req.getParameter("usernation");
	         String eaddress=req.getParameter("useraddress");
	         String eeducation=req.getParameter("usereducation");
	        
	         PrintWriter pw=resp.getWriter();
	         boolean b=x.findxiugai(ename, eage, esex, eidcard, eborn, enation, eaddress, eeducation, eid);
	         if(b){
	        	 pw.write("true");
	         }else{
	        	 pw.write("false");
	         }
	        
	}
  
}
